package dao

import (
	"time"
)

// 这是 XxlJobLog 的全局公开dao对象
var XxlJobLogDao = xxlJobLogDao{}

// 这是 xxl_job_log表 的实体类
type XxlJobLog struct {
	Id                     int       `json:"id" form:"id" v:"id"`
	JobGroup               int       `json:"job_group" form:"job_group" v:"job_group"`                                                 // 执行器主键ID
	JobId                  int       `json:"job_id" form:"job_id" v:"job_id"`                                                          // 任务，主键ID
	ExecutorAddress        string    `json:"executor_address" form:"executor_address" v:"executor_address"`                            // 执行器地址，本次执行的地址
	ExecutorHandler        string    `json:"executor_handler" form:"executor_handler" v:"executor_handler"`                            // 执行器任务handler
	ExecutorParam          string    `json:"executor_param" form:"executor_param" v:"executor_param"`                                  // 执行器任务参数
	ExecutorShardingParam  string    `json:"executor_sharding_param" form:"executor_sharding_param" v:"executor_sharding_param"`       // 执行器任务分片参数，格式如 1/2
	ExecutorFailRetryCount int       `json:"executor_fail_retry_count" form:"executor_fail_retry_count" v:"executor_fail_retry_count"` // 失败重试次数
	TriggerTime            time.Time `json:"trigger_time" form:"trigger_time" v:"trigger_time"`                                        // 调度-时间
	TriggerCode            int       `json:"trigger_code" form:"trigger_code" v:"trigger_code"`                                        // 调度-结果
	TriggerMsg             string    `json:"trigger_msg" form:"trigger_msg" v:"trigger_msg"`                                           // 调度-日志
	HandleTime             time.Time `json:"handle_time" form:"handle_time" v:"handle_time"`                                           // 执行-时间
	HandleCode             int       `json:"handle_code" form:"handle_code" v:"handle_code"`                                           // 执行-状态
	HandleMsg              string    `json:"handle_msg" form:"handle_msg" v:"handle_msg"`                                              // 执行-日志
	AlarmStatus            int       `json:"alarm_status" form:"alarm_status" v:"alarm_status"`                                        // 告警状态：0-默认、1-无需告警、2-告警成功、3-告警失败

}

// 注意:这是 XxlJobLog 的私有dao对象
type xxlJobLogDao struct {
	Insert func(arg XxlJobLog) int       //插入一条记录
	Update func(arg XxlJobLog) int       //更新一条记录
	Delete func(arg XxlJobLog) int       //删除一条记录
	Select func(arg XxlJobLog) XxlJobLog //获取一条记录
}
